#!/bin/ash

# mount the /boot partition in read only

case "$1" in
  start)
    BOOTPART=$(/recalbox/scripts/recalbox-part.sh boot) || exit 1
    mount | cut -d ' ' -f 3 | grep -q '/boot' || mount "${BOOTPART}" -o ro /boot || exit 1
    ;;
  stop)
    umount /boot || exit 1
    ;;
  *)
    echo "Usage: $0 <start|stop>"
    exit 1
esac

exit 0
